package com.lcm.basic.p7.sync;

import java.util.*;
import java.util.stream.Stream;

/**
 * @author Coder-lcm
 * @date 2021/4/3
 */
public class TestSynchronized {
    public static void main(String[] args) {
        // 使用Collections工具类可以创建同步的集合对象
        Collection c  = Collections.synchronizedCollection(new ArrayList<>());
        List list = Collections.synchronizedList(new ArrayList<>());
        Set set = Collections.synchronizedSet(new HashSet<>());
        Map m = Collections.synchronizedMap(new HashMap<>());


        Boolean b1 = new Boolean(true);
        Boolean b2 = new Boolean(true);
        System.out.println(b1.equals(b2));
    }
}

